package com.adkun.community.dao;

import com.adkun.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper {
    List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit);

    int selectCountByEntity(int entityType, int entityId);

    /**
     * 找用户的评论数量
     * @param userId
     * @return
     */
    int selectCountByUserId(int userId);

    /**
     * 用户的评论列表
     * @param userId
     * @return
     */
    List<Comment> selectCommentsByUserId(int userId, int offset, int limit);

    int insertComment(Comment comment);

    Comment selectCommentById(int id);

}
